//
//  NewsTableViewCell.m
//  Today
//
//  Created by dllo on 15/5/25.
//  Copyright (c) 2015年 fanfan. All rights reserved.
//

#import "NewsTableViewCell.h"

@implementation NewsTableViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createNewsCell];
    }
    return self;
}
- (void)createNewsCell
{
    self.NewsImage = [[UIImageView alloc]init];
    [self.contentView addSubview:self.NewsImage];
    [self.NewsImage release];
    
    self.NewsTitle = [[UILabel alloc]init];
    [self.contentView addSubview:self.NewsTitle];
    [self.NewsTitle release];
    
    self.NewsTime = [[UILabel alloc]init];
    [self.contentView addSubview:self.NewsTime];
    [self.NewsTitle release];
    
    self.NewsPerson = [[UILabel alloc]init];
    [self.contentView addSubview:self.NewsPerson];
    [self.NewsPerson release];
    
    self.PIcture = [[UIImageView alloc]init];
    [self.contentView addSubview:self.PIcture];
    [self.PIcture release];
    
    
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.NewsImage.frame = CGRectMake(5, 0, 100, 100);
    self.NewsImage.backgroundColor = [UIColor colorWithRed:0.311 green:0.500 blue:0.454 alpha:1.000];
    
    self.NewsTitle.frame = CGRectMake(110, 0, 255, 70);
    self.NewsTitle.font = [UIFont systemFontOfSize:20.0];
    self.NewsTitle.numberOfLines = 3;
    [self.NewsTitle sizeToFit];
    self.NewsTitle.textColor = [UIColor colorWithRed:0.401 green:0.322 blue:1.000 alpha:1.000];
    
    
    self.NewsTime.frame = CGRectMake(110, 70, 120, 20);
    ;
    self.NewsTime.textColor = [UIColor colorWithRed:1.000 green:0.319 blue:0.075 alpha:1.000]
    ;
    self.NewsTime.font = [UIFont systemFontOfSize:10.0];
    self.NewsPerson.frame = CGRectMake(300, 70, 30, 20);
    self.NewsPerson.textColor =[UIColor colorWithRed:1.000 green:0.310 blue:0.148 alpha:1.000]
    
    ;
    self.NewsPerson.font = [UIFont systemFontOfSize:10.0];
    
    self.PIcture.frame = CGRectMake(335, 80, 40, 20);
    self.PIcture.image = [UIImage imageNamed:@"icon_sponsor_blue@2x"];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
